package j17;

import java.util.Scanner;

public class ex_movieMain {
	ex_movieMain a = new ex_movieMain();
	private static String title = "배열을 이용한 영화 정보 등록 프로그램";
	private static String menu = " >>> 추가(1), 조회(2), 종료(0)";
	private static String addmsg = "영화이름, 주연배우, 제작사, 영화관 위치, 가격";
	private static String exitmsg = " 프로그램을 종료합니다.";
	public static void main(String[] args) {
		
		ex_movie msrv = new ex_movie();
		Scanner sc = new Scanner(System.in);
		
		System.out.println(title);
		while(true) {
			System.out.println(menu);
			switch (sc.nextInt()) {
			case 1: addMovie(sc,msrv); break;
			case 2: showMovie(msrv); break;
			case 0: sc.close();
			System.out.println(exitmsg); System.exit(0); break;
			
			}
		}
	}
	private static void showMovie(ex_movie msrv) {
		System.out.println(msrv.readMovie());
		
	}
	private static void addMovie(Scanner sc, ex_movie msrv) {
		System.out.println(addmsg);
		ex_movieVO mvo = new ex_movieVO(sc.next(), sc.next(), sc.next(), sc.next(), sc.nextInt());
		msrv.addMovie(mvo);
	}

}
